//
//  InfoTableViewCell.m
//  e-Learning
//
//  Created by rimi on 16/6/25.
//  Copyright © 2016年 YJ. All rights reserved.
//

#import "InfoTableViewCell.h"

#define WIDTH Screen_Width/3
#define HEIGHT Screen_Height/8*7*0.8*0.28

@implementation InfoTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = [UIColor colorWithRed:67/255.0 green:67/255.0 blue:67/255.0 alpha:1];
        [self.contentView addSubview:self.headerImage];
        [self.contentView addSubview:self.headerName];
        [self.contentView addSubview:self.content];
        [self.contentView addSubview:self.time];
        [self.contentView addSubview:self.reply];
        
    }
    return self;
}


- (UIImageView *)headerImage{
    if (!_headerImage) {
        _headerImage = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH*0.07,HEIGHT*0.05, WIDTH*0.1, WIDTH*0.1)];
    }
    return _headerImage;
}

- (UILabel *)headerName{
    if (!_headerName) {
        _headerName = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.19, HEIGHT*0.05, WIDTH*0.7, WIDTH*0.1)];
    }
    return _headerName;
}

- (UILabel *)content{
    if (!_content) {
        _content = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.07, WIDTH*0.1+HEIGHT*0.07, WIDTH*0.9, HEIGHT*0.5)];
    }
    return _content;
}

- (UILabel *)time{
    if (!_time) {
        _time = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.07, HEIGHT*0.85, WIDTH*0.7, HEIGHT*0.1)];
    }
    return _time;
}

- (UIButton *)reply{
    if (!_reply) {
        _reply = [[UIButton alloc] initWithFrame:CGRectMake(WIDTH*0.78,HEIGHT*0.85, WIDTH*0.2, HEIGHT*0.1)];
        [_reply setTitle:@"回复" forState:UIControlStateNormal];
        [_reply setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _reply.titleLabel.font = [UIFont systemFontOfSize:20];
        _reply.layer.borderColor = [UIColor whiteColor].CGColor;
        _reply.layer.borderWidth = 1;
    }
    return _reply;
}











- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
